|
Ubicación en el Menú |
---|
Draft → Utilities → AutoGroup |
Entornos de trabajo |
Draft, Arch |
Atajo de teclado por defecto |
Ninguno |
Introducido en versión |
- |
Ver también |
Ninguno |
The Draft AutoGroup command changes the active Draft Layer or, optionally, the active Std Group or group-like BIM object. New Draft and BIM objects are automatically placed in this active layer or group.
This command was originally intended for groups, hence its name, but was redesigned in FreeCAD version 0.19 when a layer system was introduced. Because handling layers is now the default for the command the rest of this page will primarily focus on layers.
The layer menu of the Draft Tray
See also: Preferences Editor and Draft Preferences.
See also: Autogenerated API documentation and FreeCAD Scripting Basics.
If the Draft Workbench is active the FreeCADGui application object has a draftToolBar
property. This draftToolBar
object has an autogroup
property, which contains the name of the active autogroup, or is None
if no autogroup is active. To change the active autogroup use the setAutoGroup
method of the draftToolBar
object. To put objects in the active autogroup use the autogroup
method of the Draft module.
# This code only works if the Draft Workbench is active!
import FreeCAD as App
import FreeCADGui as Gui
import Draft
doc = App.newDocument()
polygon1 = Draft.make_polygon(5, radius=1000)
polygon2 = Draft.make_polygon(3, radius=500)
polygon3 = Draft.make_polygon(6, radius=220)
layer = Draft.make_layer()
Gui.draftToolBar.setAutoGroup(layer.Name)
Draft.autogroup(polygon1)
Draft.autogroup(polygon2)
Draft.autogroup(polygon3)
doc.recompute()